Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

feat/32 - mapa #49

Merged
merged 15 commits into from
Mar 11, 2024
Merged

feat/32 - mapa #49

merged 15 commits into from
Mar 11, 2024

Conversation

AitorRD
Copy link
Contributor

@AitorRD AitorRD commented Mar 1, 2024

Resuelve la isse #32

  • Implementado el mapa (con openStreetMap).
  • Toma la ubicación del usuario según el navegador.
  • Los marcadores de evento aparecen situados en el mapa.

@AitorRD AitorRD added code Tasks related to coding enhancement New feature or request frontend Issues related to frontend development labels Mar 1, 2024
@AitorRD AitorRD requested review from ferferga, adrrf and horgarler March 1, 2024 18:49
@AitorRD AitorRD self-assigned this Mar 1, 2024
@AitorRD AitorRD linked an issue Mar 2, 2024 that may be closed by this pull request
Closed
Copy link

cloudflare-workers-and-pages bot commented Mar 3, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 527fb3e
Status: ✅  Deploy successful!
Preview URL: https://2ffbca44.ocial-app.pages.dev
Branch Preview URL: https://feat-32-mapa.ocial-app.pages.dev

View logs

@AitorRD
Copy link
Contributor Author

AitorRD commented Mar 8, 2024

Se podría cambiar el Status del Hotspot a Safe, ya que el navegador te pregunta el permiso de toma de ubicación sin el permiso no puede hacerlo. Por lo que cambiaría el estado a Safe para que no de problemas en el rebase. @ispp-2324-ocial/qa @ispp-2324-ocial/frontend

Quality Gate Failed Quality Gate failed

Failed conditions 1 Security Hotspot

See analysis details on SonarCloud

@AitorRD AitorRD mentioned this pull request Mar 8, 2024
Closed
Copy link
Contributor

@ferferga ferferga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dos cosillas tontas


const userLocationMarker = marker([latitude, longitude], { icon: userIcon }).addTo(mapInstance);

userLocationMarker.bindPopup('Tu ubicación');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mira el vídeo que he hecho sobre como traducir el texto y que he mandado por Discord (ahora añadiré todos los vídeos al README para que estén más a mano).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

He resuelto este cambio en el commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

El problema sigue siendo el error en el async

@AitorRD AitorRD force-pushed the feat/32-mapa branch 2 times, most recently from ca3035b to 3bfed08 Compare March 9, 2024 16:25
@@ -95,6 +95,7 @@ function createMapLayer(): void {
}
}
},
// eslint-disable-next-line promise/prefer-await-to-callbacks
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Esta se ha añadido para corregir el error de lint que daba en esta función, puesto que no era un error per se, simplemente te recomendaba hacer uso de promises y async lo cual acarreaba más warnings de los que se podía solucionar.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AitorRD El problema era efectivamente del linter, sin embargo, mágicamente le ha gustado al añadir la opción de HighAccuracy (la vi el otro día en la documentación de MDN y se me olvidó decírtelo, pero para nuestro caso es estrictamente necesario) 😁.

Copy link
Contributor

@ferferga ferferga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mira si todo funciona bien con mis últimos cambios (se te olvidó sacar el instanciamiento del mapa fuera del callback, y he eliminado algunos console.log, es lo único extra además de añadir el highAccuracy que he cambiado).

Y por último (y ya con esto prometo que va todo para dentro 🙏), en vez de utilizar console.error para los errores, utiliza el notificador que ha hecho @paupenfer1, así si el usuario no ha dado permisos de acceso a la ubicación o ha habido cualquier tipo de error se lo mostramos, y no se lo ocultamos de forma opaca.

AitorRD and others added 2 commits March 11, 2024 21:41
ferferga
ferferga previously approved these changes Mar 11, 2024
Comment on lines 81 to 84
if (!mapViewSet) {
mapInstance!.setView([latitude, longitude], 15);
mapViewSet = true;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Esta lógica está mal, en sucesivas iteraciones siempre evaluará a false y no actualizará la posición en el mapa.

Lo arreglo en mi push para terminar ya este PR, lo he testeado a mano, si hay cualquier otro problema manda un PR con un hotfix

@ferferga ferferga force-pushed the feat/32-mapa branch 2 times, most recently from 3c74602 to 7a5a0a1 Compare March 11, 2024 23:47
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@ferferga ferferga enabled auto-merge (rebase) March 11, 2024 23:50
@ferferga ferferga merged commit 28ab26e into develop Mar 11, 2024
12 checks passed
@ferferga ferferga deleted the feat/32-mapa branch March 11, 2024 23:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
code Tasks related to coding enhancement New feature or request frontend Issues related to frontend development
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mapa
2 participants